<?php include '../public/header.php' ?>
<?php include '../public/header_index.php' ?>
<?php include "../public/header_edit.php"?>
<script src="/static/admin/js/math.js"></script>
<link rel="stylesheet" type="text/css" href="/static/admin/css/main.css">
<body class="laytp-container">
<div style="height: 45px"></div>
<div id="opt_nav">
</div>
<div id="dialog">
    <div class="page-title" id="page-title">
        <div class="page-title-con">
            <span class="title" id="titss"></span>
            <div class="move_title"></div>
            <div class="page-title-opt-list">
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
</div>


<div class="layui-card" id="table-card">
    <div class="layui-card-body">
        <div class="layui-row">
            <div class="layui-col-md12" id="table_list">
                <div class="layui-card-body">
                    <table id="datalist" lay-filter="datalist"></table>
                </div>
            </div>
        </div>
    </div>
</div>

<script>

    var type = getQueryVariable('type');
    if(type == 'chan'){
        type = '产值(元)'
    }else if(type == 'shou'){
        type = '收款(元)'
    }else if(type == 'zhi'){
        type = '支出(元)'
    }

    var list = parent.getList();
    var data = [];
    list.forEach(function (item, index) {
        item['LAY_TABLE_INDEX'] = index;
        data.push(item);
    });

    setTimeout(function () {
        layui.use(["laytp",'laypage','table','dropdown','form','soulTable'], function () {
            var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable;


            setSouTableExport('资金成本表');
            var mytable = table.render({
                elem: "#datalist",id: "datalist"
                ,totalRow: true
                ,cols: [[ //标题栏
                    {field:'qingname',title:'名称',merge:true,totalRowText:'合计'}
                    ,{field:'rate',title:'完成比率',merge:['qingname']}
                    ,{field:'ratio',title:'税后价系数',merge:['qingname']}
                    ,{field:'fenname',title:'分部项名称'}
                    ,{field:'money',title:'金额(元)',totalRow:true}
                    ,{field:'fenrate',title:'完成比率'}
                    ,{field:'optmoney',title: type,totalRow:true}
                ]]
                ,data: data
                , done: function (res) {
                    soulTable.render(this);
                }
            });

        });
    });




</script>
</body>
</html>
